
const {Service} =require('egg');

class userService extends Service{
   
    async login({username,pwd}){//登录
        let sql=`select * from login where username=? and pwd=?`;
        return await this.app.mysql.query(sql,[username,pwd]);
    };
    async checkuser(username){
        let sql=`select * from login where username=?`;
        return await this.app.mysql.query(sql,[username])
    };
    async registry({id,username,pwd}){
        let sql=`insert into login (id,username,pwd) values(?,?,?)`;
        return this.app.mysql.query(sql,[id,username,pwd]);
    }
};
module.exports = userService;